]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
AuthPrompt: properly remove user widgets
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 9 Oct 2014 16:05:11 +0000 (12:05 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Mon, 13 Oct 2014 15:50:11 +0000 (11:50 -0400)
When replacing a user widget, we need to destroy the child, not just
unparent it, or it will leak.

https://bugzilla.gnome.org/show_bug.cgi?id=738256

js/gdm/authPrompt.js

index 4160a566828f07e7cd7730cc874a1b728de4430f..3b435de307f3ddf0702ee6809891787b4b617686 100644 (file)
@@ -419,11 +419,13 @@ const AuthPrompt = new Lang.Class({
     },
 
     setUser: function(user) {
+        let oldChild = this._userWell.get_child();
+        if (oldChild)
+            oldChild.destroy();
+
         if (user) {
             let userWidget = new UserWidget.UserWidget(user);
             this._userWell.set_child(userWidget.actor);
-        } else {
-            this._userWell.set_child(null);
         }
     },